<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>


<%@ include file="head.jsp"%>

<!-- 列表的url变量 -->
<c:set var="userListUrl" value="${baseurl }/admin/type/list/"></c:set>
<c:set var="searchParam" value=""></c:set>


<div class="row">
	<ol class="breadcrumb">
		<li><a href="${baseurl }/admin">首页</a></li>
		<li class="active">分類列表</li>
	</ol>


	<a href="${baseurl }/admin/type/addview"><button type="button"
			class="btn btn-success">新增</button></a>
	<button id="delusers" type="button" class="btn btn-danger">批量删除</button>


	<table class="table table-striped table-bordered table-hover">
		<caption></caption>
		<thead>
			<tr>
				<th><input type="checkbox" id="select_uid" /></th>
				<th>ID</th>
				<th>分类名称</th>
				<th>分类图标</th>
				<th>PID</th>
				<th>分类等级</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>

			<tr>
				<form action="${userListUrl}1/${typemap.typeid}">
					<th></th>
					<th scope="row"><input type="text" class="form-control "
						name="id" id="" value="" placeholder=""></th>
					<td><input type="text" class="form-control " name="username"
						id="" value="" placeholder=""></td>
					<td><input type="datetime" class="form-control" id=""
						placeholder="" disabled="disabled"></td>
					<td><input id="datetimepicker"
						data-date-format="yyyy-mm-dd H:m:s" type="text" name="createtime"
						class="form-control " value="" id="" placeholder=""></td>
					<td><input type="text" class="form-control " name="" id=""
						value="" placeholder=""></td>
					<td>
						<button type="submit" class="btn btn-primary">搜索</button>
					</td>
				</form>
			</tr>


			<c:forEach items="${typemap.typelist }" var="type">
				<tr>
					<th scope="row"><input type="checkbox" class="ids" name="ids"
						value="${type.id }" /></th>
					<th scope="row">${type.id }</th>
					<td>${type.name }</td>
					<td><img width="50" data-action="zoom"
						src="${baseurl }${type.image }" /></td>
					<td>${type.pid }</td>
					<td>${type.level }</td>
					<td><a href="${baseurl }/admin/type/list/1/${type.id}"><button
								type="button" class="btn btn-success  btn-xs">下级分类</button></a> <a
						href="${baseurl }/admin/user/details/${type.id}"><button
								type="button" class="btn btn-success  btn-xs">详情</button></a> <a
						href="${baseurl }/admin/user/updateview/${type.id}">
							<button type="button" class="btn btn-info  btn-xs">编辑</button>
					</a>
						<button type="button" data-id="${type.id }"
							data-name="${type.name }" class="btn btn-danger  btn-xs deluser">删除</button>

					</td>
				</tr>
			</c:forEach>

		</tbody>

		<tfoot>
			<tr>
				<td colspan="5" align="center"><c:if
						test="${typemap.page == 0 }">
						<h5>没有任何数据</h5>
					</c:if> <c:if test="${typemap.page != 0 }">

						<nav aria-label="Page navigation">
							<ul class="pagination">
								<li><a
									href="${userListUrl}1/${typemap.typeid}${searchParam}"
									aria-label="Previous"> <span aria-hidden="true">首页</span>
								</a></li>
								<!-- 如果已经是第一页则给一个禁用样式 -->
								<li class='<c:if test="${p - 1 <= 0 }"> disabled </c:if>'>

									<!-- 判断是否显示上一页的链接 --> <c:if test="${p - 1 > 0 }">
										<a
											href="${userListUrl}${p - 1 }/${typemap.typeid}${searchParam}"
											aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
										</a>
									</c:if> <c:if test="${p - 1 <= 0 }">
										<a aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
										</a>
									</c:if>

								</li>

								<!-- 循环输出页码 -->
								<c:forEach begin="1" end="${typemap.page}" var="i">
									<li class="<c:if test='${i == typemap.p}'>active</c:if>"><a
										href="${userListUrl}${i }/${typemap.typeid}${searchParam}">${i }</a></li>
								</c:forEach>

								<!-- 如果已经是最后一页则给一个禁用样式 -->
								<li
									class='<c:if test="${p + 1 > typemap.page }"> disabled </c:if>'>

									<!-- 判断是否显示下一页的链接 --> <c:if test="${p + 1 <= typemap.page}">
										<a
											href="${userListUrl}${p + 1 }/${typemap.typeid}${searchParam}"
											aria-label="Next"> <span aria-hidden="true">&raquo;</span>
										</a>
									</c:if> <c:if test="${p + 1 > typemap.page }">
										<a aria-label="Previous"> <span aria-hidden="true">&raquo;</span>
										</a>
									</c:if>

								</li>

								<li><a
									href="${userListUrl}${typemap.page}/${typemap.typeid}${searchParam}"
									aria-label="Previous"> <span aria-hidden="true">末页</span>
								</a></li>
							</ul>
						</nav>

					</c:if></td>
			</tr>

		</tfoot>
	</table>

</div>

<%@ include file="footer.jsp"%>

